Manages the images in the component. More...
Public Member Functions | |
| System * | getSystem () const |
| Image * | createOrRetrieve (nkMemory::StringView name) |
| Image * | record (nkMemory::StringView name, nkMemory::UniquePtr< Image > resource) |
| Image * | get (nkMemory::StringView name) const |
| Image * | getByIndex (unsigned int index) const |
| void | rename (nkMemory::StringView oldName, nkMemory::StringView newName) |
| void | erase (nkMemory::StringView name) |
| nkMemory::UniquePtr< Image > | relinquish (nkMemory::StringView name) |
Manages the images in the component.
| System* nkWinUi::ImageManager::getSystem | ( | ) | const |
| Image* nkWinUi::ImageManager::createOrRetrieve | ( | nkMemory::StringView | name | ) |
Creates if unavailable, or retrieves if available, an image.
| name | The name of the image to retrieve. |
| Image* nkWinUi::ImageManager::record | ( | nkMemory::StringView | name, |
| nkMemory::UniquePtr< Image > | resource | ||
| ) |
Records an already existing resource in the manager, passing its ownership around.
| name | The name under which the resource should be recorded. |
| resource | The resource to record. |
| Image* nkWinUi::ImageManager::get | ( | nkMemory::StringView | name | ) | const |
Retrieves an image.
| name | The name of the image to retrieve. |
| Image* nkWinUi::ImageManager::getByIndex | ( | unsigned int | index | ) | const |
Get an image, by index. Note that one index can map to a different image after memory is changed. Useful to loop over all available images in one go.
| index | The index of the image to retrieve. |
| void nkWinUi::ImageManager::rename | ( | nkMemory::StringView | oldName, |
| nkMemory::StringView | newName | ||
| ) |
Renames an image.
| oldName | The name of the image to rename. |
| newName | The name to reassign to the image. |
| void nkWinUi::ImageManager::erase | ( | nkMemory::StringView | name | ) |
Erases and frees an image.
| name | The name of the image to erase. |
| nkMemory::UniquePtr<Image> nkWinUi::ImageManager::relinquish | ( | nkMemory::StringView | name | ) |
Requests the manager to relinquish the ownership of a resource and pass it around.
| name | The name of the recorded resource to relinquish. |